package cate.common.table.res.hero.introduction.row;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import cp.solution.util.str.Str;
import easy.java.dev.note.NoteField;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;


public class HeroYokeRow extends ERow {
    @NoteField(value = "英雄ID")
    public String heroStr;

    @NoteField(value = "奖励")
    public String rewardStr;

    @NoteField(value = "属性提升")
    public String attrStr;

    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        this.id = xrw.getInteger("ID");
        this.heroStr = xrw.getString("英雄ID");
        this.rewardStr = xrw.getString("收集奖励");
        this.attrStr= xrw.getString("属性提升");
    }

    public List<Integer> herosList = new ArrayList<>();

    @Override
    public void decode() {
        if(StringUtils.isNotBlank(heroStr)){
            herosList = Str.strArr2intList(heroStr.split("#"));
        }
    }
}
